﻿/**
 * Insertion of the reference data into the database Zen4SyncRepository.
 *
 */

CREATE PROCEDURE [Admin].[sp_z4s_insert_reference_data]
AS

/*************************************/
/*                                   */
/*         activityType              */
/*                                   */
/*************************************/

DELETE FROM Scenario.activityType;
INSERT INTO Scenario.activityType (activityType_id, activityType_name) VALUES ('4B719513-D6D7-40F7-BBAC-D5E45745F183', 'Sync Session');
INSERT INTO Scenario.activityType (activityType_id, activityType_name) VALUES ('8281DF90-4EBA-4E20-9487-DF5034DE0C9C', 'MEF Execution');
INSERT INTO Scenario.activityType (activityType_id, activityType_name) VALUES ('3F912BC2-E647-46A1-9B1A-B76D06FED3EA', 'SQL Server Execution');
INSERT INTO Scenario.activityType (activityType_id, activityType_name) VALUES ('7E662C4A-F0B0-490C-808D-C9E5B7867C90', 'SQL Server Check Data');
INSERT INTO Scenario.activityType (activityType_id, activityType_name) VALUES ('A41A6035-AE9F-4397-84AC-1D396E6FC409', 'SQL CE Execution');
INSERT INTO Scenario.activityType (activityType_id, activityType_name) VALUES ('9DB2B54E-7CD2-4F3E-B15B-1434EAB2BE50', 'SQL CE Check Data');
INSERT INTO Scenario.activityType (activityType_id, activityType_name) VALUES ('5B03C91F-81B0-4360-A483-5666F3B31E16', 'SQL CE Backup');

/*************************************/
/*                                   */
/*          networkType              */
/*                                   */
/*************************************/

DELETE FROM MergeSync.networkType;
INSERT INTO MergeSync.networkType (networkType_id, networkType_name) VALUES ('9BAD68FE-1402-4BA3-84CB-5B38A4DBC640', 'System.Data.SqlServerCe.NetworkType.DefaultNetwork');
INSERT INTO MergeSync.networkType (networkType_id, networkType_name) VALUES ('256780C5-4D41-4A5A-93FA-AB97460AD88E', 'System.Data.SqlServerCe.NetworkType.MultiProtocol'); 
INSERT INTO MergeSync.networkType (networkType_id, networkType_name) VALUES ('3B3ADCD3-F925-4FC0-B5DF-CD87F70A63B7', 'System.Data.SqlServerCe.NetworkType.TcpIpSockets'); 

/*************************************/
/*                                   */
/*          exchangeType             */
/*                                   */
/*************************************/

DELETE FROM MergeSync.exchangeType;
INSERT INTO MergeSync.exchangeType (exchangeType_id, exchangeType_name) VALUES ('06180660-667A-4004-879A-0B415EEB5415', 'System.Data.SqlServerCe.ExchangeType.BiDirectional');
INSERT INTO MergeSync.exchangeType (exchangeType_id, exchangeType_name) VALUES ('67A7BF80-C8F9-4DE6-A17F-29CC37E015FA', 'System.Data.SqlServerCe.ExchangeType.None');
INSERT INTO MergeSync.exchangeType (exchangeType_id, exchangeType_name) VALUES ('A051BF88-22D5-4C12-B953-89F28BEB74E4', 'System.Data.SqlServerCe.ExchangeType.Upload');
  
/*************************************/
/*                                   */
/*          securityType             */
/*                                   */
/*************************************/

DELETE FROM MergeSync.securityType;
INSERT INTO MergeSync.securityType (securityType_id, securityType_name) VALUES ('CE9FFFF7-12A4-4527-8AF6-820FB3325A77', 'System.Data.SqlServerCe.SecurityType.DBAuthentication');
INSERT INTO MergeSync.securityType (securityType_id, securityType_name) VALUES ('53F061F4-C984-4E60-AFB4-BB84CC828F17', 'System.Data.SqlServerCe.SecurityType.NTAuthentication');

/*************************************/
/*                                   */
/*      snapshotTransferType         */
/*                                   */
/*************************************/

DELETE FROM MergeSync.snapshotTransferType;
INSERT INTO MergeSync.snapshotTransferType(snapshotTransferType_id, snapshotTransferType_name) VALUES ('C8F40DB6-F941-456F-8428-3AF16288B59C', 'System.Data.SqlServerCe.SnapshotTransferType.FTP');
INSERT INTO MergeSync.snapshotTransferType(snapshotTransferType_id, snapshotTransferType_name) VALUES ('85E81462-571F-44A8-BC8C-CB012530DD93', 'System.Data.SqlServerCe.SnapshotTransferType.UNC');
 
/*************************************/
/*                                   */
/*          validateType             */
/*                                   */
/*************************************/

DELETE FROM MergeSync.validateType;
INSERT INTO MergeSync.validateType(validateType_id, validateType_name) VALUES ('E490E71E-77E8-47B2-957B-BC499A6B2371', 'System.Data.SqlServerCe.ValidateType.RowCountOnly');
INSERT INTO MergeSync.validateType(validateType_id, validateType_name) VALUES ('11A7D431-3741-4DD3-AFCA-CE8F099C7C66', 'System.Data.SqlServerCe.ValidateType.NoValidation');

/*************************************/
/*                                   */
/*        testSessionState           */
/*                                   */
/*************************************/
DELETE FROM [Admin].testSessionState;
INSERT INTO [Admin].testSessionState(testSessionState_id, testSessionState_name) VALUES ('9f5e44e3-96ec-467d-a0c7-a7e94d3c8b88', 'Planned');
INSERT INTO [Admin].testSessionState(testSessionState_id, testSessionState_name) VALUES ('2b52de79-2837-48c0-8cd5-d0f286657203', 'Waiting for start');
INSERT INTO [Admin].testSessionState(testSessionState_id, testSessionState_name) VALUES ('a6d0c57c-94a3-4541-b5ec-280de97dd37f', 'In progress');
INSERT INTO [Admin].testSessionState(testSessionState_id, testSessionState_name) VALUES ('22ac4072-c8e1-4d7e-aaba-a8383febabb9', 'Completed');

/*************************************/
/*                                   */
/*          sqlValueType             */
/*                                   */
/*************************************/
DELETE FROM [Admin].sqlValueType;
INSERT INTO [Admin].sqlValueType(sqlValueType_id, sqlValueType_sqlName, sqlValueType_dotNetName) VALUES ('581147b9-2e26-459b-8eb8-820c7cf67745', 'uniqueidentifier', 'System.Guid');
INSERT INTO [Admin].sqlValueType(sqlValueType_id, sqlValueType_sqlName, sqlValueType_dotNetName) VALUES ('65a98742-b90b-4735-8349-7a3ab63e7f44', 'int', 'int');
INSERT INTO [Admin].sqlValueType(sqlValueType_id, sqlValueType_sqlName, sqlValueType_dotNetName) VALUES ('fd4b68e4-04e7-4795-9e39-450af6bb2424', 'varchar', 'String');
INSERT INTO [Admin].sqlValueType(sqlValueType_id, sqlValueType_sqlName, sqlValueType_dotNetName) VALUES ('f7ad067b-06ab-41d9-89ad-7152b32f127e', 'nvarchar', 'String');
INSERT INTO [Admin].sqlValueType(sqlValueType_id, sqlValueType_sqlName, sqlValueType_dotNetName) VALUES ('7a52ba06-aeee-445c-8fba-7b584e4e8782', 'bit', 'bool');
INSERT INTO [Admin].sqlValueType(sqlValueType_id, sqlValueType_sqlName, sqlValueType_dotNetName) VALUES ('64b6e43b-e247-4430-a54e-81722b104ecc', 'datetimeoffset', 'System.DateTime');
INSERT INTO [Admin].sqlValueType(sqlValueType_id, sqlValueType_sqlName, sqlValueType_dotNetName) VALUES ('b1677f88-5682-4b82-a912-3c825b8188e4', 'xml', 'System.Xml.Linq.XElement');
INSERT INTO [Admin].sqlValueType(sqlValueType_id, sqlValueType_sqlName, sqlValueType_dotNetName) VALUES ('85f58f6f-7d47-4f6d-84ca-63703b94455f', 'smallint', 'int');

RETURN 0